<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/1/29
 * Time: 11:29
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait CashCouponTrait
{
    use BaseTrait;

    // 合作者key
    protected $key;
    // 代金券名称
    protected $name;
    // 代金券描述
    protected $description;
    // 代金券数量
    protected $num;
    // 代金券面额
    protected $denomination;
    // (满减)限额
    protected $limit;
    // 代金券有效期开始时间
    protected $start_time;
    // 代金券有效期截止时间
    protected $end_time;
    // 代金券ID
    protected $cash_coupon_id;
    // 验证秘钥
    protected $loginSession;
    // 用户ID
    protected $user_id;
    // 小程序路径
    protected $page;
    // 小程序码参数
    protected $scene;

    public function __construct(Request $request)
    {
        $this->key = $request->input('key', '');
        $this->name = $request->input('name', '');
        $this->description = $request->input('description', '');
        $this->num = $request->input('num', 0);
        $this->denomination = $request->input('denomination', 0);
        $this->limit = $request->input('limit', 0);
        $this->start_time = $request->input('start_time', 0);
        $this->end_time = $request->input('end_time', 0);
        $this->cash_coupon_id = $request->input('cash_coupon_id', 0);
        $this->loginSession = $request->input('loginSession', '');
        $this->user_id = $request->input('user_id', 0);
        $this->page = $request->input('page', '');
        $this->scene = $request->input('scene', 0);
    }
}